﻿using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Server.Data
{
	public class DbParameterHpr
	{
		public static void AddParam(IDbCommand command, string name, object value)
		{
			var param = command.CreateParameter();
			param.ParameterName = name;
			param.Value = value;
			command.Parameters.Add(param);
		}
	}


	public class MySqlConnector
	{
		public IDbConnection Connection { get; private set; }

		public void Connect()
		{
			this.Connection = new MySqlConnection(connbuilder.ConnectionString);
		}
		MySqlConnectionStringBuilder connbuilder = new MySqlConnectionStringBuilder();
		public MySqlConnector(string username, string password, string server, string database)
		{
			connbuilder.Database = database;
			connbuilder.UserID = username;
			connbuilder.Password = password;
			connbuilder.Server = server;
			connbuilder.ConvertZeroDateTime = true;

		}

	}
}
